package com.xly.webclick.presenter;

import com.xly.webclick.base.BasePresenter;
import com.xly.webclick.model.AddressData;
import com.xly.webclick.net.Request;
import com.xly.webclick.net.RetrofitApi;
import com.xly.webclick.vi.GetAddressInterface;

/**
 * Created by xuleyuan on 2018/8/28
 */

public class GetAddressPresenter extends BasePresenter<GetAddressInterface,AddressData> {


    @Override
    public Request<AddressData> createRequest() {
        return new Request<AddressData>().setMethod(Request.GET).setUrl(RetrofitApi.ADDRESS);
    }

    @Override
    public void onGetResult(AddressData data) {
        getBaseInterface().onGetAddress(data);
    }

    @Override
    public void onError(Throwable throwable) {
        getBaseInterface().onAddressError();
    }
}
